import { createRouter, createWebHistory } from "vue-router";
import { App } from "vue";
import whiteRoutes from "./routes/whiteRoutes";
import authRoutes from "./routes/authRoutes";
import { setupRouterGuard } from "./guards";

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [...whiteRoutes, ...authRoutes],
});

export function setupRouter(app: App<Element>) {
  app.use(router);
  setupRouterGuard(router);
}

export default router;
